import base64
import pickle

class CookieSecret(object):
    @classmethod
    def dumps(cls, data):
        data_bytes = pickle.dumps(data)
        base64_bytes = base64.b64encode(data_bytes)
        return base64_bytes.decode()


    @classmethod
    def loads(cls, data):
        base64_decode = base64.b64decode(data)
        pickle_result = pickle.loads(base64_decode)
        return pickle_result
